<template>
  <div class="header">
    <div class="header_content">
      <div class="logo_div">
        <div style="display:flex;flex-direction:column;justify-content:flex-end">
          <!-- <span class="logo_title">后台管理系统</span> -->
        </div>
      </div>
      <div class="account_div">
        <div class="avatar">
          <label class="name_label">{{ nickname }}</label>
        </div>
        <div style="display:flex;flex-direction:row;margin-left:10px">
          <span class="el-dropdown-link">
                {{ nickname }}
              </span>
          <span style="font-size:16px;color:blue;margin-left:15px;cursor:pointer" @click="exitMethod">
                退出
              </span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      nickname: '',
    }
  },

  mounted() {
    this.$nextTick(function() {
      setTimeout(() => {
        // this.nickname = this.$store.state.userInfo.nickname
      }, 80)
    })
  },

  methods: {
    exitMethod() {
      this.$store.commit('LOG_OUT')
      this.$router.push({
        name: 'login'
      })
    }
  },

}

</script>
<style>

</style>
